package com.mxpio.erp.common.technology.entity;

import javax.persistence.*;

import com.mxpio.erp.common.jpa.policy.ResCodeGeneratorPolicy;
import com.mxpioframework.jpa.annotation.Generator;
import com.mxpioframework.security.annotation.Dict;
import com.mxpioframework.security.entity.BaseEntity;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.List;

@Data
@EqualsAndHashCode(callSuper=false)
@Entity
@Table(name = "MB_ERP_TECHNOLOGY_WROKCENTER")
@Schema(description="工作中心")
public class WorkCenter extends BaseEntity {

	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name = "WORK_CENTER_CODE_", updatable = false)
	@Schema(description = "工作中心编号")
	@Generator(policy = ResCodeGeneratorPolicy.class)
	private String workCenterCode;

	@Column(name = "WORK_CENTER_NAME_")
	@Schema(description = "工作中心名称")
	private String workCenterName;
	
	@Column(name = "WORK_CENTER_SHORT_NAME_")
	@Schema(description = "工作中心简称")
	private String workCenterShortName;
	
	@Column(name = "WORK_CENTER_TYPE_")
	@Schema(description = "工作中心类型")
	@Dict(dicCode = "ERP_TECH_WORK_CENTER_TYPE")
	private String workCenterType;
	
	@Column(name = "WORK_SHOP_CODE_")
	@Schema(description = "所属车间")
	@Dict(dicCode="workShopCode",dicEntity=WorkShop.class,dicText="workShopName")
	private String workShopCode;
	
	@Column(name = "MEMO_")
	@Schema(description = "备注")
	private String memo;

	@Dict(dicCode = "ERP_MES_DISPATCH_MODE")
	@Column(name = "DISPATCH_MODE_")
	@Schema(description = "派工模式")
	private String dispatchMode;

	@Transient
	private List<WorkUnit> workUnitList;
}
